<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/jsp/admin/include/headBase.jsp"/>
</head>
<body style="padding-left: 40px">
<br>
<br>
<br>
<div>

    <form id="form_businessInfo" class="form-horizontal row">
        <div class="col-sm-10" id="div-error"></div>



        <div class="form-group col-sm-5">
            <label class="control-label col-sm-4">业务号：</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" name="businessCode">
            </div>
        </div>

        <div class="form-group col-sm-5">
            <label class="col-sm-4 control-label">开始时间：</label>
            <div class="col-sm-8">
                <div class="input-group date form_date timeInput">
                                                <span class="input-group-addon"><span
                                                        class="glyphicon glyphicon-calendar"></span></span>
                    <input class="form-control" type="text"
                           name="startTime" readonly>
                </div>
            </div>
        </div>
        <div class="form-group col-sm-5">
            <label class="col-sm-4 control-label">结束时间：</label>
            <div class="col-sm-8">
                <div class="input-group date form_date  timeInput">
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-calendar"></span>
                                                </span>
                    <input class="form-control" type="text" name="endTime" readonly>
                </div>
            </div>
        </div>

        <div class="form-group col-sm-5">
            <label class="col-sm-4 control-label">核查结果：</label>
            <div class="col-sm-8">
                <select class="form-control" name="result">
                    <option value="">&nbsp;</option>
                    <option value="1">不合格</option>
                    <option value="2">部分合格</option>
                    <option value="3">合格</option>
                </select>
            </div>
        </div>


        <div class="form-group col-sm-5">
            <div class="col-sm-8 col-sm-offset-4">
                <button type="submit"  class="btn btn-default btn-success">
                    <span class="glyphicon glyphicon-plus-sign"></span>&nbsp;添&nbsp;加&nbsp;
                </button>
            </div>
        </div>
    </form>
</div>
<jsp:include page="/WEB-INF/jsp/admin/include/footerBase.jsp"/>
<script>
    $(function () {
        <%--bootstrapValidator--%>
       var $form= $("#form_businessInfo");
        $form.bootstrapValidator({
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                businessCode: {
                    validators: {
                        notEmpty: {
                            message: '不能为空！'
                        }
                    }
                },
                startTime: {
                    validators: {
                        notEmpty: {
                            message: '不能为空！'
                        }
                    }
                },
                endTime: {
                    validators: {
                        notEmpty: {
                            message: '不能为空！'
                        }
                    }
                },
                result: {
                    validators: {
                        notEmpty: {
                            message: '不能为空！'
                        }
                    }
                }
            }
        }).on('success.form.bv', function (e) {
            e.preventDefault();
            $.sysPlugin.superAjax({
                data: $(e.target).serialize(),
                url: "${base}/httpPage/addBusinessResult",
                operateType: 'insert',
                showSuccessAlert: true,
                showWarnAlert: false,
                successCall: function (data) {
                },
                errorCall: function (data) {
                    $.sysPlugin.errorCallBack(data, {
                        errorAddress: $("#div-error"),
                        form: $form
                    })
                }
            });
        });
        $.sysPlugin.initSimpleSelect2();
        $.sysPlugin.initDateTimeInput();
    });
</script>

</body>
</html>